import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'
import Index from '@/views/index/index.vue'
import Login from '@/views/login/index.vue'
import User from '@/views/user/index.vue'
import Category from '@/views/category/index.vue'
import Supplier from '@/views/supplier/index.vue'
import Spu from '@/views/spu/index.vue'
import Warehouse from '@/views/warehouse/index.vue'
import Logistics from '@/views/logistics/index.vue'
import Warehousing from '@/views/warehousing/index.vue'
import Outbound from '@/views/outbound/index.vue'
import Stocktaking from '@/views/stocktaking/index.vue'
import Operations from '@/views/operations/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/' , component: Layout,children: [
      { path: '', component: Index },
      { path: '/user', component: User },
      { path: '/category', component: Category },
      { path: '/supplier', component: Supplier },
      { path: '/spu', component: Spu },
      { path: '/warehouse', component: Warehouse },
      { path: '/logistics', component: Logistics },
      { path: '/warehousing', component: Warehousing },
      { path: '/outbound', component: Outbound },
      { path: '/stocktaking', component: Stocktaking },
      { path: '/operations', component: Operations },
    ]},
    { path: '/login', component: Login }
  ],
})

export default router
